<?php
/*	$dom=new DOMDocument('1.0', 'iso-8859-1');
	include_once '../class/class.php';
	$sql="select * from leituras where dia=current_date() order by numero";
	$c=new ClassCon();
	$dom->formatOutput=true;
	$root=$dom->createElement('leituras');
	$dom->appendChild($root);
	
	$result=$c->seleciona($sql);
	if ($c->Ok($result)){
		while ($c->listar($result)){
			$no=$dom->createElement($c->row["numero"] . "ª leitura");
			$roor->appendChild($no);
			
			$at1=$dom->createAttribute('livro');
			$no->appendChild($at1);
			$at1->appendChild($dom->createTextNode($c->row["livro"]));
			
			$at2=$dom->createAttribute('texto');
			$no->appendChild($at2);
			$at2->appendChild($dom->createTextNode($c->row["texto"]));
		}
	}
	echo "Saving all the document:\n";
//echo $doc->saveXML() . "\n";

echo "Saving only the title part:\n";
echo $doc->saveXML($no);  */


$doc = new DOMDocument('1.0');
// we want a nice output
$doc->formatOutput = true;

$root = $doc->createElement('book');
$root = $doc->appendChild($root);

$title = $doc->createElement('title');
$title = $root->appendChild($title);

$text = $doc->createTextNode('Thiasdasditle');
$text = $title->appendChild($text);

echo "Saving all the document:\n";
echo $doc->saveXML() . "\n";

echo "Saving only the title part:\n";
echo $doc->saveXML($title);
?>